import {Utils} from '../common.js'
import {WidgetEventDispatcher} from './base-widget.js'

export default class Placeholder {
    constructor(dispatcher) {
        Utils.DefineProperty(this, 'SUID', '__PLACE_HOLDER_WIDGET__', false, true, false);
        this._layoutElem = Utils.CreateHTMLElement(`
<section>
    <div class='d-flex'>
        <div class="slog_section_left d-flex">
            <a href="javascript:;" class="slog_menu_a bi bi-plus"></a>
        </div>
        <div class="slog_section_right" style="color:darkgrey;"><center>EOF</center></div>
    </div>
</section>`);
        this._layoutElem.querySelector('a').addEventListener('click', (e) => {
            dispatcher.DispatchEvent(WidgetEventDispatcher.Event.EVT_WIDGET_BEFORE_CREATE, undefined);
        });
    }
    get layoutElem() {return this._layoutElem;}
};

